//
//  HomeBottomView.swift
//  EyeVisionForPatients
//
//  Created by PMC on 2020/3/27.
//  Copyright © 2020 tao Tao. All rights reserved.
//

import UIKit

class HomeBottomView: UIView {
    
    var viewTapped: ((_ viewType: HomeButtonViewType) -> Void)?

    @IBOutlet weak var registrationView: HomeButtonView!
    
    @IBOutlet weak var advisoryView: HomeButtonView!
    
    @IBOutlet weak var cloudView: HomeButtonView!
    
    @IBOutlet weak var teamView: HomeButtonView!
    
    @IBOutlet weak var nurseView: HomeButtonView!
    
    func configureUI() {
        registrationView.configure(with: .registration)
        nurseView.configure(with: .nurse)
        advisoryView.configure(with: .advisory)
        cloudView.configure(with: .cloud)
        teamView.configure(with: .team)
        
        
        registrationView.tappedClosure = { [weak self] type in
            self?.viewTapped?(type)
        }
        
        advisoryView.tappedClosure = { [weak self] type in
            self?.viewTapped?(type)
        }
        
        cloudView.tappedClosure = { [weak self] type in
            self?.viewTapped?(type)
        }
        
        teamView.tappedClosure = { [weak self] type in
            self?.viewTapped?(type)
        }
        
        nurseView.tappedClosure = { [weak self] type in
            self?.viewTapped?(type)
        }
    }
}
